1. Field of the Invention
This invention relates generally to resource sharing in computing devices and more specifically to a system and method for hardware assisted resource sharing.
2. Description of the Related Art
When two or more applications compete for a shared resource, unexpected outcomes may result. For example, consider a first software application and a second software application attempting to use a shared hardware resource. Both software applications may try to use the hardware simultaneously, and, if there is no arbitration between the applications, conflicts may arise. In another example, the second software application may interrupt the first software application and gain access to the hardware. In this case, the second software application may preempt the first software application and access the hardware through an interrupt service routine that is not visible to the first software application. During the interrupt service, the second software application may change one or more settings in the shared hardware resource that the first software application cannot detect, thereby causing unexpected results.
To further illustrate the conflict between two software applications, consider the typical operation of the display subsystem in a computer system. The operating system may make a system call to the Video Basic Input Output System (VBIOS) while a display driver is performing an operation. If the call to the VBIOS requires the use of a hardware resource that the display driver is in the process of modifying, a resource conflict results and at least one of the software applications will incorrectly perform its modifications.
To address the fact that software applications may disrupt one another, registers or buffers typically are used to pass state information about hardware resource usage. This practice requires hardware assistance and writeable memory, two items the VBIOS has difficulty accessing within its operating environment. Without hardware assistance, shared memory is error prone and subject to risk because there will always be the possibility that two software processes will attempt to modify the shared memory at nearly the same time, rendering the state information inaccurate.
As the foregoing illustrates, what is needed in the art is a way to more effectively share a resource between two or more clients.